package org.codefinger.test.spring;

import org.codefinger.test.Customer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringDemo {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		// 这里做演示，手动加载Spring文件（实际项目中Spring配置文件可能在Web容器中做加载，但原理都是一样）
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

		// 从容器中获取我们的控制层做测试
		MyService myService = applicationContext.getBean(MyService.class);

		myService.getMapList(15, "张三");

		myService.add(new Customer("李四", 20, 100));

		myService.update(new Customer("王五", 17, 30));

	}

}
